package bit.lotterysystem.service.dto;

import bit.lotterysystem.service.enums.ActivityPrizeStatusEnum;
import bit.lotterysystem.service.enums.ActivityPrizeTiersEnum;
import bit.lotterysystem.service.enums.ActivityStatusEnum;
import bit.lotterysystem.service.enums.ActivityUserStatusEnum;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class ActivityDetailDTO {

    //活动信息
    private Long activityId;

    private String activityName;

    private String desc;//活动描述

    private ActivityStatusEnum status;

    public Boolean valid(){
        return status.equals(ActivityStatusEnum.RUNNING);
    }

    //奖品信息列表
    private List<PrizeDTO> prizeDTOList;

    //人员信息列表
    private List<UserDTO> userDTOList;

    /**
     * Lombok 注解（如 @Data、@Getter、@Setter）默认只对当前注解标注的类生效
     */
    @Data
    public static class PrizeDTO{
        //奖品id
        private Long prizeId;
        //奖品名
        private String name;
        //图片索引
        private String imageUrl;

        private BigDecimal price;

        private String description;
        //奖品等级
        private ActivityPrizeTiersEnum tiers;

        private Long prizeAmount;

        private ActivityPrizeStatusEnum status;

        public Boolean valid(){
            return status.equals(ActivityPrizeStatusEnum.INIT);
        }
    }

    @Data
    public static class UserDTO{
        private Long userId;

        private String userName;

        private ActivityUserStatusEnum status;

        public Boolean valid(){
            return status.equals(ActivityUserStatusEnum.INIT);
        }
    }


}
